package org.linlinjava.litemall.core.util;

import com.github.pagehelper.Page;

import java.util.ArrayList;
import java.util.List;

public class PageList<E> extends ArrayList<E> {

    private long total;
    private int pageNum;
    private int pageSize;
    private int pages;

    public PageList(List list) {
        if (list instanceof Page) {
            Page page = (Page) list;
            this.total = page.getTotal();
            this.pageNum = page.getPageNum();
            this.pageSize = page.getPageSize();
            this.pages = page.getPages();
        }
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }
}
